package com.bra.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ToggleButton;

import com.bra.R;
import com.bra.ui.base.BaseActivity;
import com.bra.utils.CommonUtils;
import com.bra.utils.DataCleanManager;
import com.bra.utils.ToastUtil;

/**
 * 轮播详情界面
 * 
 * @author lenovo
 *
 */
public class CarouselDetailsActivity extends BaseActivity {
	private ImageView activity_back;
	private TextView activity_title;
    private WebView webview_lbweb_xq;
    private String url;
   private Intent intent;
	@Override
	protected View onCreateView(LayoutInflater inflater,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.activity_carouseldetails, null);
	}

	@Override
	protected void onViewCreated(Bundle savedInstanceState) {
		activity_title = (TextView) findViewById(R.id.activity_title);
		activity_back = (ImageView) findViewById(R.id.activity_back);
		activity_title.setText("活动详情");
		webview_lbweb_xq= (WebView) findViewById(R.id.webview_lbweb_xq);
		intent=getIntent();
		url=intent.getStringExtra("url");
	}

	@Override
	protected void setListener() {
		activity_back.setOnClickListener(click);
	
	}
	private  void init(){		
        //设置WebView属性，能够执行Javascript脚本  
		webview_lbweb_xq.getSettings().setJavaScriptEnabled(true);  
        //加载需要显示的网页  
		webview_lbweb_xq.loadUrl(url);  
        //设置Web视图  
		webview_lbweb_xq.setWebViewClient(new HelloWebViewClient ());  
}
//Web视图  
private class HelloWebViewClient extends WebViewClient {  
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {  
        view.loadUrl(url);  
        return true;  
    }  
}  
	private View.OnClickListener click = new OnClickListener() {

		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.activity_back:
				finish();
				break;	
			default:
				break;
			}

		}
	};
}